﻿using Ducu.GLB.Global;
using Ducu.GLB.Global.Story;
using Ducu.SRV.ServiceInteface;
using Ducu.SRV.ViewModel.Shared;
using System.Web;

namespace Ducu.SRV.UIDevService
{
    public class SharedService : ISharedService
    {
        public _NavigatorModel GetNavigator()
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies[CookieName.USER_ID];
            if (cookie != null)
            {
                int userId = int.Parse(cookie.Value);
                if (userId == User.ID_YEZI)
                {
                    return new _NavigatorModel
                    {
                        UserName = "yezi"
                    };
                }
                if (userId == User.ID_ABU)
                {
                    return new _NavigatorModel
                    {
                        UserName = User.NAME_ABU
                    };
                }

            }
            return new _NavigatorModel();
        }
    }
}
